Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Serialize Transaction Data for all Transaction Types#522

Merged
amiecorso merged 14 commits intomasterfrom
tx-data
Nov 12, 2020
Merged

Serialize Transaction Data for all Transaction Types#522
amiecorso merged 14 commits intomasterfrom
tx-data

Conversation

@keefertaylor
Copy link
Contributor

High Level Overview of Change

Serialize transaction specific data for all functions now that serialization for these protocol buffers are implemented.

Context of Change

Note that this change is just hooking up protocol buffers.

The protocol buffer library ensures (via a oneof) that if:

transaction.getTransactionDataCase() === Transaction.TransactionDataCase.FOO

then

transaction.getFoo() !== undefined

For that reason, lots of lines in this PR are not tested because they are a logical fallacy based on the sanity checks provided by generated protocol buffer code.

Also note that all transaction data cases are not hit because we know:

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Before / After

After this change, we can serialize all specific transaction data. Note that some common fields, such as signers are still not serialized. That functionality is coming in #519.

Also note there are several TODOs in this class which will get cleaned up as a final task for this functionality.

Test Plan

CI shows that this does not affect existing behavior. Rational for not providing additional unit tests is provided above.

@keefertaylor keefertaylor changed the title [WIP] Serialize Transaction Data Serialize Transaction Data for all Transaction Types Sep 3, 2020
@keefertaylor keefertaylor marked this pull request as ready for review September 3, 2020 23:51
@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #522 (30aa3d2) into master (6b1772c) will decrease coverage by 6.59%.
The diff coverage is 1.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
- Coverage   92.46%   85.87%   -6.60%     
==========================================
  Files          11       11              
  Lines         677      729      +52     
  Branches      160      173      +13     
==========================================
  Hits          626      626              
- Misses         26       78      +52     
  Partials       25       25              
Impacted Files Coverage Δ
src/XRP/serializer.ts 83.57% <1.88%> (-8.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b1772c...30aa3d2. Read the comment docs.

Copy link
Contributor

@amiecorso amiecorso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

Copy link
Contributor

@tedkalaw tedkalaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, seems reasonable

@amiecorso amiecorso requested a review from mvadari as a code owner November 12, 2020 23:49
@amiecorso amiecorso merged commit 5845680 into master Nov 12, 2020
@amiecorso amiecorso deleted the tx-data branch November 12, 2020 23:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants